import request from '@/utils/request'
/*
* 获取组织架构的数据
 */
export function getDepartments () {
  return request({
    url: '/company/department'
  })
}
/*
* 删除组织部门
 */
export function delDepartment (id) {
  return request({
    url: `/company/department/${id}`,
    method: 'DELETE'
  })
}

/*
* 新增部门
 */
export function addDepartment (data) {
  return request({
    url: '/company/department',
    method: 'POST',
    data
  })
}

/**
 * 编辑部门
 *
 * ***/
export function updateDepartments (data) {
  return request({
    url: `/company/department/${data.id}`,
    //  get post put delete
    method: 'put',
    data
  })
}
/** *
 * 获取部门详情
 * ***/
export function getDepartDetail (id) {
  return request({
    url: `/company/department/${id}`
  })
}
